package org.txazo.stat.web.action.base;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.struts2.ServletActionContext;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.ParentPackage;

import com.opensymphony.xwork2.ActionSupport;

/**
 * JsonBaseAction
 * 
 * @author Tu XiaoZhou
 * @since 2013-04-12
 * 
 */
@ParentPackage("json-default")
@Namespace("/json")
public class JsonBaseAction extends ActionSupport {

	private static final long serialVersionUID = 1L;

	protected HttpServletRequest request = null;
	protected HttpServletResponse response = null;
	protected HttpSession session = null;
	protected ServletContext application = null;

	public JsonBaseAction() {
		super();

		setRequest();
		setResponse();
		setSession();
		setApplication();
	}

	public void setRequest() {
		request = ServletActionContext.getRequest();
	}

	public void setResponse() {
		response = ServletActionContext.getResponse();
	}

	public void setSession() {
		session = request.getSession();
	}

	public void setApplication() {
		application = session.getServletContext();
	}

}
